package com.bl.weilan.common;

import lombok.Builder;
import lombok.Data;

/**
 * Created by liangweikang on 2017/5/6.
 */
@Data
@Builder
public class CommonServiceException extends RuntimeException {

    private String code;
    private String message;

    public CommonServiceException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public CommonServiceException(ApiResponseCode apiResponseCode) {
        super(apiResponseCode.getMsg());
        this.code = apiResponseCode.getCode();
        this.message = apiResponseCode.getMsg();
    }

}
